package net.chrone.quickpayapi.service.impl;

import java.util.List;

import net.chrone.quickpayapi.mapper.RegionInfoMapper;
import net.chrone.quickpayapi.model.RegionInfo;
import net.chrone.quickpayapi.model.RegionInfoExample;
import net.chrone.quickpayapi.model.RegionInfoExample.Criteria;
import net.chrone.quickpayapi.service.RegionInfoService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("regionInfoService")
public class RegionInfoServiceImpl implements RegionInfoService {
	
	@Autowired
	private RegionInfoMapper regionInfoMapper;

	@Override
	public RegionInfo findById(String cityCd) {
		RegionInfoExample example = new RegionInfoExample();
		Criteria criteria = example.createCriteria();
		criteria.andFyRegionCdEqualTo(cityCd);
		List<RegionInfo> list = regionInfoMapper.selectByExample(example);
		if(list!=null&&list.size()>0){
			return list.get(0);
		}
		return null;
	}

}
